<?php
namespace App\Model;

class MallShop extends Model
{
    // 表名
    protected $table = 'mall_shop';
    
    // 保护属性
    protected $guarded = [];
    
    protected $attributes = [
        'status'        => self::STATUS_POST,
    ];
    
    // 格式
    protected $casts = [
        'images' => 'array'
    ];

    protected $dateFormat = 'U';
    
    // 状态
    const STATUS_NO     = -1;
    const STATUS_POST   = 0;
    const STATUS_OK     = 1;
    
    // 用户
    public function user()
    {
        return $this->belongsTo(User::class, 'user_id');
    }
}